local hx__yunchou = fk.CreateSkill {
  name = "hx__yunchou",
}

hx__yunchou:addEffect("active", {
  anim_type = "drawcard",
  prompt = "你可以选择至多X名角色令其各摸至多2张牌（X为你的体力上限）",
  can_use = function(self, player)
    return player:usedSkillTimes(hx__yunchou.name, Player.HistoryPhase) < 1
  end,
  card_num = 0,
  min_target_num = 1,
  target_filter = function(self, player, to_select, selected)
    return #selected < player.maxHp
  end,
  card_filter = Util.FalseFunc,
  on_use = function(self, room, effect)
    local player = effect.from
    room:sortByAction(effect.tos)
    for _, p in ipairs(effect.tos) do
      local choice = room:askToChoice(player, {
        choices = {"1","2"},
        skill_name = hx__yunchou.name,
        prompt = "#hx__yunchou-choice::"..p.id,
      })
      if choice == "1" then
        p:drawCards(1)
      else
        p:drawCards(2)
      end
    end
    player:drawCards(#effect.tos, hx__yunchou.name)
  end,
})

return hx__yunchou